#ifndef DATA_PROC_H
#define DATA_PROC_H

#include <vector>
#include <cstdint>
#include <stdexcept>
#include <QByteArray>
class DATA_PROC
{
public:
    DATA_PROC();
    enum rxClass{
        HandShakeRequst,
        SelfCheckInfo,
        InputParameter,
        TimeAligned,
    };
    std::pair<uint8_t, uint8_t> calculateChecksum(const std::vector<uint8_t>& data);
    std::pair<uint8_t, uint8_t> getInfoFromReceived(const std::vector<uint8_t>& data);
    QByteArray data4responseHandShake(void);
    QByteArray data4selfCheckInfo(void);
    QByteArray data4inputPresetParameter(bool isRelative, uint32_t time);
    QByteArray data4timeAlign(uint32_t time );
    QByteArray stdString2Hex(std::string str);
    std::vector<uint8_t> QByteArray2Vector(const QByteArray& byteArray);
    QByteArray Vector2QByteArray(const std::vector<uint8_t>& vec);
    void delay(int milliseconds);
    std::vector<uint8_t> fillSendData(std::vector<uint8_t>& data);

};

#endif // DATA_PROC_H
